package com.dmzc.stage1.chapter1;

/***
 * 测试start之后还能不能修改名称
 */
public class TestSetName {


    public static void main(String[] args) {
        Thread t = new Thread() {
            @Override
            public void run() {
                while (true) {


                    System.out.println(currentThread().getName());
                    currentThread().setName("sdasd");
                }
            }
        };
        t.start();
        while (true) {
            t.setName("修改名字");
            System.out.println(t.getName());
        }
    }
}
